@echo off

set LOCAL_SOCKET_PORT=1089
set REMOTE_SOCKET_PORT=1089
set SSH_CMD=user@host -p port

title Proxy: %SSH_CMD%

echo local socket server: 127.0.0.1:%LOCAL_SOCKET_PORT%
echo;
echo ssh cmd: [ ssh -N -R 127.0.0.1:%REMOTE_SOCKET_PORT%:127.0.0.1:%LOCAL_SOCKET_PORT% %SSH_CMD% ]
echo;
echo #################### Command to Set Proxy ####################
echo;
echo export http_proxy="socks5h://127.0.0.1:%REMOTE_SOCKET_PORT%"
echo export https_proxy="socks5h://127.0.0.1:%REMOTE_SOCKET_PORT%"
echo;
echo ###########################################################

ssh -N -R 127.0.0.1:%REMOTE_SOCKET_PORT%:127.0.0.1:%LOCAL_SOCKET_PORT% %SSH_CMD%

pause